export default function (context) {
  const agent = navigator.userAgent.toLowerCase()
  const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream
  const MAC =
    /macintosh|mac os x/i.test(navigator.userAgent) && !window.MSStream
  const android = /Android/.test(navigator.userAgent) && !window.MSStream
  if (agent.includes('win32') >= 0 || agent.includes('wow32') >= 0) {
    return 'windows'
  }
  if (agent.includes('win64') >= 0 || agent.includes('wow64') >= 0) {
    return 'windows'
  }
  if (iOS) {
    return 'iphone'
  }
  if (MAC) {
    return 'mac'
  }
  if (android) {
    return 'andriod'
  }
  return 'unknow'
}
